package com.lovo.bean;


import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

public class UserBean {
    private Integer userId;
    /**
     * 用户名
     */
    @Pattern(regexp = "[a-zA-Z\\u4e00-\\u9fa5]{2,}",message = "姓名必须为两个以上的汉字或字母")
    private String userName;
    /**
     * 用户密码
     */
    @Pattern(regexp = "[a-zA-Z0-9]{2,}",message = "密码必须为两个以上的字母或数字")
    private String password;
    /**
     * 用户邮箱
     */
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确！")
    private String mail;
    /**
     * 用户头像地址
     */

    private String imgUrl;

    public UserBean() {
    }

    public UserBean(String userName, String password, String mail, String imgUrl) {
        this.userName = userName;
        this.password = password;
        this.mail = mail;
        this.imgUrl = imgUrl;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "userId='" + userId + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", mail='" + mail + '\'' +
                ", imgUrl='" + imgUrl + '\'' +
                '}';
    }
}
